import typer
from .fastapi import fastapi
from .db import db

cli = typer.Typer(name="cli", help="custom cli")

cli.add_typer(db, name="db")
# cli.add_typer(env, name="env")
cli.add_typer(fastapi)


# @cli.command(name="cli")
# def main():
#     typer.echo("main is run")


@cli.callback()
def main(ctx: typer.Context):
    print("main is run", ctx)
    if ctx.invoked_subcommand is None:
        typer.echo(ctx.get_help())
        raise typer.Exit()


if __name__ == "__main__":
    cli()
